package org.naivecode.audio;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class LineDetectorContext {
	private final List<LinearSequence> activeLines = new ArrayList<LinearSequence>();
	private final List<LinearSequence> finishedLines = new ArrayList<LinearSequence>();

	public void terminateLine(LinearSequence ls) {
		activeLines.remove(ls);
		finishedLines.add(ls);
	}

	public LinearSequence startLine(float start) {
		final LinearSequence ls = new LinearSequence(start);
		activeLines.add(ls);
		return ls;
	}

	public Collection<LinearSequence> getActiveLines() {
		return activeLines;
	}

	public Collection<LinearSequence> getFinishedLines() {
		return finishedLines;
	}
}
